package com.baizhi.bzmall.admin.controller;

import com.baizhi.bzmall.admin.service.MenuService;
import com.baizhi.bzmall.common.vo.ResultEntity;
import com.baizhi.bzmall.entity.Menu;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("menu")
public class MenuController {
    @Autowired
    private MenuService ms;
    @GetMapping
    public ResultEntity<List<Menu>> selectAllMenu(){
        List<Menu> menus = ms.selectAllMenu();
        return ResultEntity.ok(menus);
    }
    @GetMapping("/permission")
    public ResultEntity<List<Menu>> selectAllPermission(){
        List<Menu> menus = ms.selectAllPermission();
        return ResultEntity.ok(menus);
    }

}
